//
// DepTree
//
// Copyright (C) jextra.net.
//
//  This file is part of the net.jextra.dep Library.
//
//  The net.jextra.dep Library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  The net.jextra.dep Library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with the net.jextra.dep Library; if not, write to the Free
//  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
//  02111-1307 USA.
//

package net.jextra.dep;

import java.util.*;

/**
 * <p>
 * Represents the results of reading a tree of components. It represents the walking of the dependency repos.
 * </p>
 */
public class DepTree
{
    // ============================================================
    // Fields
    // ============================================================

    private LinkedHashSet<DepComponent> rootComponents;

    // ============================================================
    // Constructors
    // ============================================================

    public DepTree()
        throws Exception
    {
        rootComponents = new LinkedHashSet<DepComponent>();
    }

    // ============================================================
    // Methods
    // ============================================================

    // ----------
    // public
    // ----------

    public void clear()
    {
        rootComponents.clear();
    }

    public void addRootComponent( DepComponent rootComponent )
    {
        rootComponents.add( rootComponent );
    }

    public Collection<DepComponent> getRootComponents()
    {
        return rootComponents;
    }
}
